import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { FrancInfoVO, FrancInfoForm, FrancInfoQuery } from '@/api/tearoom/francInfo/types';

/**
 * 查询加盟管理列表
 * @param query
 * @returns {*}
 */

export const listFrancInfo = (query?: FrancInfoQuery): AxiosPromise<FrancInfoVO[]> => {
  return request({
    url: '/tearoom/francInfo/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询加盟管理详细
 * @param id
 */
export const getFrancInfo = (id: string | number): AxiosPromise<FrancInfoVO> => {
  return request({
    url: '/tearoom/francInfo/' + id,
    method: 'get'
  });
};

/**
 * 新增加盟管理
 * @param data
 */
export const addFrancInfo = (data: FrancInfoForm) => {
  return request({
    url: '/tearoom/francInfo',
    method: 'post',
    data: data
  });
};

/**
 * 修改加盟管理
 * @param data
 */
export const updateFrancInfo = (data: FrancInfoForm) => {
  return request({
    url: '/tearoom/francInfo',
    method: 'put',
    data: data
  });
};

/**
 * 删除加盟管理
 * @param id
 */
export const delFrancInfo = (id: string | number | Array<string | number>) => {
  return request({
    url: '/tearoom/francInfo/' + id,
    method: 'delete'
  });
};
